import request from "@/utils/request";

// 获取下拉框数据
export const getOptionsList = async (data) => {
  const res = await request({
    url: `/common/dict/get`,
    method: "post",
    data
  });
  const arr = (res.data || []).map((item) => {
    return { ...item, label: item.value, value: item.key };
  });
  return {
    ...res,
    data: arr
  };
};

// 获取搜索匹配建议列表
export const getMatchList = (data) => {
  return request({
    url: "/common/search",
    method: "post",
    data
  });
};

// 获取首页统计数据
export const getIndexInfo = () => {
  return request({
    url: "/common/data/statistics",
    method: "post"
  });
};
